﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Web.Security;
using System.Web.Profile;
using EHTSaleManager.Code.DAL;
using EHTSaleManager.Code.Entity;
using EHTSaleManager.Code.BLL;

namespace EHTSaleManager
{
    public partial class IndexCustomerAccountBalance : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // get customer
            MembershipUser theUser = Membership.GetUser(HttpContext.Current.User.Identity.Name);
            //ProfileBase theProfile = ProfileBase.Create(HttpContext.Current.User.Identity.Name);           
            // this.lbCurrentBalanceValue.Text = theProfile.GetPropertyValue("ToltalAccount").ToString();
            // lay thong tin current balance
            string CustomerID = theUser.ProviderUserKey.ToString();
            CurrentBalance theCurrentBalance = AccountBalanceProvider.GetCurrentBalanceByCustomerID(CustomerID);
            this.lbCurrentBalanceValue.Text = theCurrentBalance.TotalAmount.ToString();   
        }
    }
}